package com.example.rmqdemo.controller;


import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:徐莹
 * @Date:2025/02/28 16:58:45
 */


@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    @RequestMapping("/test1")
    public String test1(){
        rabbitTemplate.convertAndSend("","queue","hello world");
        return "test1";
    }
}
